package shiyansanbao;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class TakeCourse {

    public static void main(String[] args) {
        Teacher te1 = new Teacher();
        Teacher te2 = new Teacher();
        Teacher te3 = new Teacher();

        System.out.println("初始化教师开设的课程!");

        te1.setId("1");

        te1.setName("王老师");

        te1.setcourses("Java");

        te1.setsex("女");

        te2.setId("2");

        te2.setName("张老师");

        te2.setcourses("数据结构");

        te2.setsex("男");

        te3.setId("3");

        te3.setName("吴老师");

        te3.setcourses("高等数学");

        te3.setsex("男");

        //tc.addCourse();
        System.out.println("教师开设的课程为：");
        System.out.println(te1.getcourses());
        System.out.println(te2.getcourses());
        System.out.println(te3.getcourses());

        System.out.println("请学生进行选课！");
        Scanner input = new Scanner(System.in);

        Students stu1=new Students();
        Students stu2=new Students();
        Students stu3=new Students();

        stu1.setId("A");
        stu1.setName("蔡同学");
        stu1.setsex("男");
        System.out.println("请学生一输入选择课程名：");
        String course_1=input.next();
        stu1.setcourses(course_1) ;
        System.out.println("学生一选择的课程为："+stu1.getcourses());
        System.out.println("学生一是否退课？请输入是或者否");
        String course_1_quit = input.next();
        if(course_1_quit.equals("是")){
            stu1.setcourses("null") ;
            System.out.println("退课成功,剩余课程为："+stu1.getcourses());
        }
        else{
            System.out.println("学生一信息更新成功！");
        }

        stu2.setId("B");
        stu2.setName("丁同学");
        stu2.setsex("女");
        System.out.println("请学生二输入选择课程名：");
        String course_2=input.next();
        stu2.setcourses(course_2) ;
        System.out.println("学生二选择的课程为："+stu2.getcourses());
        System.out.println("学生二是否退课？请输入是或者否");
        String course_2_quit = input.next();
        if(course_2_quit.equals("是")){
            stu2.setcourses("null") ;
            System.out.println("退课成功,剩余课程为："+stu2.getcourses());
        }
        else{
            System.out.println("学生二信息更新成功！");
        }



        stu3.setId("C");
        stu3.setName("罗同学");
        stu3.setsex("男");
        System.out.println("请学生三输入选择课程名：");
        String course_3=input.next();
        stu3.setcourses(course_3) ;
        System.out.println("学生选择的课程为："+stu3.getcourses());
        System.out.println("学生三是否退课？请输入是或者否");
        String course_3_quit = input.next();
        if(course_3_quit.equals("是")){
            stu3.setcourses("null") ;
            System.out.println("退课成功,剩余课程为："+stu3.getcourses());
        }
        else{
            System.out.println("学生三信息更新成功！");
        }

        Courses co1 = new Courses();
        Courses co2 = new Courses();
        Courses co3 = new Courses();
        co1.setId("a");
        co2.setId("b");
        co3.setId("c");

        co1.setName("Java");
        co2.setName("高等数学");
        co3.setName("数据结构");

        co1.setarea("一教");
        co2.setarea("二教");
        co3.setarea("三教");

        co1.settime("周一");
        co2.settime("周二");
        co3.settime("周三");

        System.out.println("开始打印学生课表信息：");
        System.out.println("   ");
        System.out.println("学生姓名"+" "+"学生编号"+" "+"学生性别"+" "+"学生选择课程");
        System.out.println(stu1.getName()+" "+stu1.getId()+" "+stu1.getsex()+" "+stu1.getcourses());
        System.out.println(stu2.getName()+" "+stu2.getId()+" "+stu2.getsex()+" "+stu2.getcourses());
        System.out.println(stu3.getName()+" "+stu3.getId()+" "+stu3.getsex()+" "+stu3.getcourses());

        System.out.println("课程编号"+" "+"课程名称"+" "+"授课时间"+" "+"授课地点");
        System.out.println(co1.getId()+" "+co1.getName()+" "+co1.gettime()+" "+co1.getarea());
        System.out.println(co2.getId()+" "+co2.getName()+" "+co2.gettime()+" "+co2.getarea());
        System.out.println(co3.getId()+" "+co3.getName()+" "+co3.gettime()+" "+co3.getarea());

        System.out.println("老师编号"+" "+"老师姓名"+" "+"老师性别"+" "+"老师所教课程");
        System.out.println(te1.getId()+" "+te1.getName()+" "+te1.getsex()+" "+te1.getcourses());
        System.out.println(te2.getId()+" "+te2.getName()+" "+te2.getsex()+" "+te2.getcourses());
        System.out.println(te3.getId()+" "+te3.getName()+" "+te3.getsex()+" "+te3.getcourses());

    }

}
